Imports System.Text.RegularExpressions
Imports System.IO
Public Class Form1
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Button1.PerformClick()
        LoadTextFile()
        End
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OpenFileDialog1.InitialDirectory = My.Settings.GetFrom
        OpenFileDialog1.ShowDialog()
        If OpenFileDialog1.SafeFileName = "" Then
            End
        Else
            TextBox2.Text = OpenFileDialog1.SafeFileName
            M_51.dir_all = OpenFileDialog1.FileName
            M_51.supplier = Mid(OpenFileDialog1.SafeFileName, InStr(OpenFileDialog1.SafeFileName, "4905", CompareMethod.Text) - (InStr(OpenFileDialog1.SafeFileName, "4905", CompareMethod.Text) - 1), InStr(OpenFileDialog1.SafeFileName, "4905", CompareMethod.Text) - 1)
        End If
    End Sub
End Class
